package team.you.change.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import team.you.change.util.Result;
import team.you.change.service.TeacherService;
import team.you.change.service.TimeTableService;

@Controller
@RequestMapping("/teacher")
public class OtherController {
    @Autowired
    private TeacherService teacherService;
    @Autowired
    private TimeTableService timeTableService;

    @RequestMapping("/getAllTeachers")
    @ResponseBody
    private Result getAllTeachers(Integer page, Integer limit) {
        return teacherService.getAllTeachers(page, limit);
    }
    @RequestMapping("/update")
    @ResponseBody
    private Result update(String id, String value, String field) {
        return teacherService.update(id, value, field);
    }
    @RequestMapping("/getTimeTable")
    @ResponseBody
    private Result getTimeTable(){
        return timeTableService.getAllTimeTable();
    }
    @RequestMapping("/selectByLike")
    @ResponseBody
    private Result selectByLike(String value,Integer type,Integer page,Integer limit) {
        return teacherService.selectByLike(value,type,page,limit);
    }
    @RequestMapping("/state")
    @ResponseBody
    private Result state(Integer id, Integer value, String field){
        return teacherService.state(id, value, field);
    }
}
